<div>
    <ol class="breadcrumb" >
        <li> <i class="fa fa-anchor"></i>
            &nbsp;用户管理
        </li>
        <li>用户列表</li>
    </ol>
    <div class="panel">
        <div class="panel-heading" > <i class="fa fa-list"></i>
            &nbsp;&nbsp;用户列表
            <!--<a href="__URL__/addUser" style="float: right;color: #ffffff">添加用户</a>-->
        </div>
        <form class="search-form" action={:U("Member/index")} method="get">
            <div class="panel-body search-panel-body retract">
                <div class="col-xs-3 search-col" >
                    <div class="input-group" >
                        <span class="input-group-addon">会员卡号</span>
                        <input type="text" name="user_pay_card" class="form-control" value="" placeholder="会员卡号"></div>
                </div>
                <div class="col-xs-2 search-col">
                    <button  type="submit" class="btn btn-warning">
                        <i class="fa fa-search"></i>
                        &nbsp;搜索
                    </button>
                </div>
            </div>
        </form>
        <table class="table table-bordered table-striped table-mcit">
            <thead>
            <tr>
                <th >
                    <empty name="is_order_name">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_name' value=''>ID</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active'  type='submit' name='order_name' value=''>
                            <if condition="$order_name eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;ID
                        </button>
                    </empty>
                </th>
                <th >
                    <empty name="is_order_name">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_name' value=''>账号</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active'  type='submit' name='order_name' value=''>
                            <if condition="$order_name eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;账号
                        </button>
                    </empty>
                </th>
                <th >
                    <empty name="is_order_name">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_name' value=''>昵称</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active'  type='submit' name='order_name' value=''>
                            <if condition="$order_name eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;昵称
                        </button>
                    </empty>
                </th>
                <th >
                    <empty name="is_order_name">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_name' value=''>会员卡号</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active'  type='submit' name='order_name' value=''>
                            <if condition="$order_name eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;会员卡号
                        </button>
                    </empty>
                </th>
                <th >
                    <empty name="is_order_name">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_name' value=''>联系电话</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active'  type='submit' name='order_name' value=''>
                            <if condition="$order_name eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;联系电话
                        </button>
                    </empty>
                </th>
                <th style="width: 15%">
                    <empty name="is_order_name">
                        <button class='btn btn-block btn-mcit' type='submit' name='order_name' value=''>操作</button>
                        <else/>
                        <button class='btn btn-block btn-mcit btn-mcit-active'  type='submit' name='order_name' value=''>
                            <if condition="$order_name eq 1">
                                <i class="fa fa-chevron-down"></i>
                                <else/>
                                <i class="fa fa-chevron-up"></i>
                            </if>
                            &nbsp;操作
                        </button>
                    </empty>
                </th>
            </tr>
            </thead>
            <tbody id="DataTableContent">
            <empty name="member">
                <td colspan="99" style="text-align:center" class="danger"> <strong><i class="fa fa-meh-o"></i>
                    &nbsp;&nbsp;当前条件下没有数据</strong>
                </td>
                <else />
                <volist name="member" id="data">
                    <if condition="$data.id eq $newid">
                        <tr class="danger">
                            <else/>
                        <tr>
                    </if>
                    <td>
                        <p class="mcit-table-p">{$data.id}</p>
                    </td>
                    <td>
                        <p class="mcit-table-p">{$data.account}</p>
                    </td>
                    <td>
                        <p class="mcit-table-p">{$data.nickname}</p>
                    </td>
                    <td>
                        <p class="mcit-table-p">{$data.user_pay_card}</p>
                    </td>
                    <td>
                        <p class="mcit-table-p">{$data.phone}</p>
                    </td>
                    <td>
                        <a class="btn btn-sm btn-warning" href="__URL__/detail/id/{$data.id}">
                            <i class="fa fa-eye"></i>
                            &nbsp;查看
                        </a>
                        <!--<a class="btn btn-sm btn-warning" href="__URL__/editUser/id/{$data.id}">
                            <i class="fa fa-edit"></i>
                            &nbsp;修改
                        </a>-->
                        <if condition="$_SESSION['role'] eq 805 or $_SESSION['role'] eq 802">
                            <a class="btn btn-sm btn-danger del_role" data-id="{$data.id}">
                                <i class="fa fa-trash-o"></i>
                                &nbsp;删除
                            </a>
                        <else /></if>
                    </td>
                    </tr>
                </volist>
            </empty>
            <tr>
                <td colspan="99" style="text-align:center">
                    <ul class="pagination">{$pageView}</ul>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<script type="text/javascript">
    $("#DataTableContent").on("click",'.del_role',function(){
        var id = $(this).attr('data-id');
        alertify.confirm("确定要删除此账号？", function (e) {
            if (e) {
                $.ajax({
                    type: "POST",
                    url:  '{:U("Member/delUser")}',
                    data: {id:id},
                    dataType: "json",
                    success: function(data){
                        if(data.state==100){
                            alertify.success(data.msg);
                            location.reload(true);
                        }else{
                            alertify.error(data.msg);
                        }
                    }
                });
            } else {
                alertify.error("取消操作！");
            }
        }, "mcit_default");
    });
/*    $("#add_role").ajaxForm({
        dataType:'json',
        clearForm:true,
        beforeSubmit:function(){
            if($("#name").val()==''){
                alertify.error("请填写要添加的角色名称");
                return false;
            }
            return true
        },
        success:function(data){
            if(data.state==100){
                alertify.success(data.msg);
                location.href = data.url;
            }else{
                alertify.error(data.msg);
            }
        }
    });*/
</script>